import requests

def baidu_push_urls(urls_file, site, token):
    url = "http://data.zz.baidu.com/urls"
    headers = {'Content-Type': 'text/plain'}
    data = open(urls_file, 'r').read()  # Read the file contents
    params = {
        'site': site,
        'token': token
    }
    response = requests.post(url, headers=headers, data=data, params=params)
    
    if response.status_code == 200:
        print("URLs pushed successfully.")
    else:
        print(f"Failed to push URLs. Status code: {response.status_code}")

# Usage example
urls_file_path = 'D:/rjaz/phpstudy_pro/WWW/www.gpg.com/data_zz_baidu/urls.txt'
site_url = 'https://www.wgj7.com'
token = 'VMliHOGKMXuX3HY9'

baidu_push_urls(urls_file_path, site_url, token)